<?php

	function preDatabaseSelect( $queryColumns, $table ) {
		return $queryColumns;
	}

	function preDatabaseDelete( $queryColumns, $table ) {
		return $queryColumns;
	}

	function preDatabaseUpdate( $queryColumns, $table ) {
		$queryColumns[ 'updatedTime' ] = date( 'Y-m-d H:i:s' );
		return $queryColumns;
	}

	function preDatabaseInsert( $queryColumns, $table ) {
		if( array_search( $table, array( 'qk_user_invite', 'qk_user', 'qk_newsfeed_queue' ) ) === false && Login::$loginStatus == Login::USER_LOGGED_IN ) {
			$queryColumns[ 'createdUserId' ] = Login::getUserInfo( 'userId' );
		}
		$queryColumns[ 'createdTime' ] = date( 'Y-m-d H:i:s' );
		$queryColumns[ 'updatedTime' ] = date( 'Y-m-d H:i:s' );
		return $queryColumns;
	}